package com.platform.config;

import com.fcjs.service.DeviceTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 
 * 项目启动初始化将时t_device表设备编码复制到t_device_token中。
 * 
 * @author hou
 * @since 2018年10月18日
 */
@Component
@Order(value = 1)
public class StartService implements ApplicationRunner {

	@Autowired
	private DeviceTokenService deviceTokenService;

	@Override
	public void run(ApplicationArguments args) throws Exception {
		deviceTokenService.saveAll();
	}
}
